Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
How does javascript Set can keep the order of insertion and still have 0(1) lookup "Set.has()"?

I have been studying data structures and I do get that Set use implementation similar to hash tables, so the input value + the hash algorithm will create a index where the value is stored...

This will yield the ability to search for such value later in constant time o(1) (disregarding collisions) however this comes at expense of not having an ordered collection since the positions in the collection are computed during insertion instead of order insertion,

So the question is how Set can keep the order and still have constant time on the lookup method Set.has()?

Thank you in advance!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda